import { request } from '@ruifox-cms/utils'

//添加类目|问答
export function saveQA(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/system/qa/saveQA',
    method: 'post',
    data
  })
}
//修改类目|问答显示状态
export function changeDisplayQa(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/system/qa/changeDisplay',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded', // 设置请求头
    },
    data
  })
}
//批量 修改类目|问答显示状态
export function changeDisplayListQa(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/system/qa/changeDisplayList',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded', // 设置请求头
    },
    data
  })
}
//获取所有问答(管理员)
export function getQA(params) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/system/qa/getQA',
    method: 'get',
    params
  })
}
//获取所有问答(用户)
export function getQAByUserQA(params) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/system/qa/getQAByUser',
    method: 'get',
    params
  })
}
//删除类目|问答
export function deleteQAQA(params) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/system/qa/deleteQA',
    method: 'delete',
    params
  })
}
//用户错题分页
export function userPagingErrorBook(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/question/errorBook/userPaging',
    method: 'post',
    data
  })
}
//用户错题排行榜
export function userTopWrongQuestionsErrorBook(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/question/errorBook/userTopWrongQuestions',
    method: 'post',
    data
  })
}
//后台错题分页
export function pagingErrorBook(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/question/errorBook/paging',
    method: 'post',
    data
  })
}
//后台错题排行榜
export function topWrongQuestionsErrorBook(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/question/errorBook/topWrongQuestions',
    method: 'post',
    data
  })
}
//移动到回收站
export function moveToRecycleBinErrorBook(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/question/errorBook/moveToRecycleBin',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded', // 设置请求头
    },
    data
  })
}
//从回收站恢复
export function recoverFormRecycleBinErrorBook(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/question/errorBook/recoverFormRecycleBin',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded', // 设置请求头
    },
    data
  })
}
//用户删除
export function userDeleteErrorBook(data) {
  return request({
    baseURL: "/10101_api",
    url: '/oltes/api/v1/question/errorBook/userDelete',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded', // 设置请求头
    },
    data
  })
}